package org.come.control;

import org.come.Frame.ZhuFrame;
import org.come.action.FromServerAction;
import org.come.until.GsonUtil;

import come.tool.Fighting.FightingMixDeal;
import come.tool.Fighting.FightingRound;
import come.tool.Fighting.Statelist;
import come.tool.handle.HandleState;

import java.awt.*;

/**
 * 接战斗回合处理
 * 
 * @author Administrator
 * 
 */
public class FightingrounddealControl implements FromServerAction {

	@Override
	public void controlMessFromServer(String mes, String type) {
		// TODO Auto-generated method stub
		FightingRound fightingRound = GsonUtil.getGsonUtil().getgson().fromJson(mes, FightingRound.class);
		if (FightingMixDeal.FightingNumber != fightingRound.getFightingsumber()) {
			return;
		}
		Statelist statelist = new Statelist();
		statelist.setRound(fightingRound.getRound());
		FightingMixDeal.CurrentRound = fightingRound.getCurrentRound();
		FightingMixDeal.BattlefieldPlay.put(fightingRound.getCurrentRound(), statelist);
		FightingMixDeal.changeState(HandleState.HANDLE_PLAY);
		FightingMixDeal.roundType=0;
		ZhuFrame.getZhuJpanel().remove((Component)ZhuFrame.getZhuJpanel().getChehui());
	}
}
